package com.har.modules.web.controller.resource;

import com.alibaba.fastjson.JSONObject;
import com.har.modules.web.service.OrderService;
import com.har.service.HtService;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author macwy
 * @Title:har-finance
 * @Package com.har.modules.web.controller.resource
 * @Description 华泰支付回调
 * @date 2018/8/1 11:43
 * @Version 1.0
 */

@Slf4j
@RestController
@RequestMapping("/ht")
public class HtResource {


    @Autowired
    private HtService htService;

    @Autowired
    private OrderService orderService;


    @RequestMapping("/callBack")
    public  String callBack(HttpServletRequest request){
        System.out.println("sss");
        return  "ok";
    }



    @RequestMapping("/pay")
    public String pay(HttpServletRequest request) throws Exception {


        JSONObject callBackJson =  htService.payCallBack(request);






        log.info("ht callBack result >> {}",callBackJson.toJSONString());

        return  "ok";

    }
}
